function anss=num2ans(x); 
% function ansc=num2ans(x); 
% Input  x  
%        vector of numbers { 0 or 1}
% Output anss
% If unidimensional String   {'Yes' if 1 or 'No' if 0}
% Else Cell array 
%
% AJ 9/6/05 
d = length( x ); 
if d==1 
    if x == 1
        anss='Yes';
    elseif x== 0
        anss='No';
    else
        error('Value in x not valid in num2ans.m')
    end
else 
    
    if all( x~=0 & x~=1 ) ==1 
        error('All entries must equal 0 or 1') 
    end 
    
    anss = cell(d,1); 
    ii=1; 
    for ii=1:d 
        temp = x(ii); 
        switch temp 
            case 0 
                anss(ii) = {'NO'}; 
            case 1 
                anss(ii) = {'YES'}; 
        end 
    end 
end 
